﻿<ad:DockableContent x:Class="Revsoft.Wabbitcode.Panels.ProjectViewer"
			 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
			 xmlns:ad="clr-namespace:AvalonDock;assembly=AvalonDock"
			 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
			 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
			 xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
			 xmlns:wcu="clr-namespace:Revsoft.Wabbitcode.Utilities"
			 mc:Ignorable="d" 
			 d:DesignHeight="300" d:DesignWidth="300"
			 Title="Project Viewer"
			 Name="ProjectViewerPanel">
	<Grid>
		<DockPanel Height="Auto" Width="Auto" LastChildFill="True" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
			<TreeView Name="projViewer">
				<TreeView.Resources>
					<Style x:Key="ExpandingImageStyle" TargetType="{x:Type Image}">
						<Setter Property="Source" Value="{DynamicResource Document}"/>
						<Style.Triggers>
							<DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=TreeViewItem}, Path=IsExpanded}" Value="True">
								<Setter Property="Source" Value="{DynamicResource Folder_Open}"/>
							</DataTrigger>
							<DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=TreeViewItem}, Path=IsExpanded}" Value="False">
								<Setter Property="Source" Value="{DynamicResource Folder_Closed}"/>
							</DataTrigger>
						</Style.Triggers>
					</Style>
				</TreeView.Resources>
				<TreeView.ItemTemplate>
					<HierarchicalDataTemplate DataType="{x:Type TreeViewItem}">
						<StackPanel Orientation="Horizontal">
							<Image Style="{StaticResource ExpandingImageStyle}">
								<Image.Resources>
									<BitmapImage x:Key="Folder_Open" UriSource="/Wabbitcode;component/Resources/Project Icons/FolderOpen_16x16.png"/>
									<BitmapImage x:Key="Folder_Closed" UriSource="/Wabbitcode;component/Resources/Project Icons/Folder_16x16.png"/>
									<BitmapImage x:Key="Document" UriSource="/Wabbitcode;component/Resources/Project Icons/GenericDocument_16x16.png"/>
								</Image.Resources>
							</Image>
							<TextBlock Text="{Binding Name}"/>
						</StackPanel>
					</HierarchicalDataTemplate>

					<!--<HierarchicalDataTemplate>
						<StackPanel Orientation="Horizontal">
							<Image Width="16" Height="16" Stretch="Fill"
												Source="{Binding UpdateSourceTrigger=PropertyChanged,
													RelativeSource={RelativeSource Mode=FindAncestor,
													AncestorType={x:Type TreeViewItem}},
													Converter={StaticResource headerToImage}}"/>
							<TextBlock Text="{Binding}" Margin="5,0" />
						</StackPanel>
					</HierarchicalDataTemplate>-->
				</TreeView.ItemTemplate>
			</TreeView>
		</DockPanel>
	</Grid>
</ad:DockableContent>
